//
//  PersonalCenterStore.m
//  NewPro
//
//  Created by RYX on 2018/10/22.
//  Copyright © 2018年 何荧红. All rights reserved.
//

#import "PersonalCenterStore.h"
#import "HttpSessionManager.h"

@implementation PersonalCenterStore



#pragma mark - 上传图片
- (void)postImgWithImg:(NSString *)imgData Success:(void(^)(NSString *imgUrl))success Failture:(void(^)(NSError *error))failure{
    
    NSString *url = [NSString stringWithFormat:@"%@/api/uploadHeadImg",IP];
    NSDictionary *dic = @{
                          @"customId":[UserDefaultsManager sharedInstance].user_id,
                          @"headimgData":imgData
                          };
    
    [HttpTool
     postUrlWithString:url parameters:dic success:^(id responseObject) {
        
         NSError *error = [HttpTool inspectError:responseObject];
         
         if (error == nil) {
             
             success(responseObject[@"data"][@"headImag"]);
         }else{
             
             failure(error);
         }
         
     } failure:^(NSError *error) {
         
         
         failure(error);
     }];

}
@end
